package com.swing.games.snake.thread;

import base.RunnableBase;
import com.swing.thread.TrayFlash;

/**
 * @author Yuang, Gongming
 * @date 2022-02-14 13:07
 */
public class ToSpeedUp extends RunnableBase {

    private volatile static ToSpeedUp toSpeedUp;

    private ToSpeedUp() {
    }

    public static ToSpeedUp start() {
        if (toSpeedUp == null) {
            synchronized (ToSpeedUp.class) {
                if (toSpeedUp == null) {
                    toSpeedUp = new ToSpeedUp();
                }
            }
        }
        return toSpeedUp;
    }

    @Override
    public void execute() throws Exception {
        System.out.println("WARNING - 吃到食物 - 加速 - 开始" + System.currentTimeMillis());
//        timer.setDelay(200);
        try {
            Thread.sleep(5000);
            System.out.println("有效时间已经消失!");
//            timer.setDelay(DELAY);
        } catch (InterruptedException ex) {
            //
        }
        System.out.println("WARNING - 吃到食物 - 加速- 结束" + System.currentTimeMillis());
    }

}
